import React, { Component } from "react"

export default class Demo extends Component {
  state = {
    username: "",
    password: "",
    repassword: "",
  }

  handleChange = (name) => {
    return (e) => {
      this.setState({
        [name]: e.target.value,
      })
    }
  }

  render() {
    return this.props.children(this.state, this.handleChange)
  }
}
